package com.bot.rf.entity;

/**
 * @program: report-form-demo
 * @description: 馆藏状态
 * @author: zyy
 * @create: 2021-02-25 11:10
 **/
public enum BookStatus {

    IN_LIBRARY("在馆", 0),
    BORROWED("借出", 1),
    LOSE("剔除",2),
    CATALOGUE("编目",3);

    private String name;
    private int index;

    BookStatus(String name, int index) {
        this.name = name;
        this.index = index;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public static BookStatus getBookStatusByIndex(int index) {
        switch (index) {
            case 1:
                return BookStatus.BORROWED;
            case 2:
                return BookStatus.LOSE;
            case 3:
                return BookStatus.CATALOGUE;
            default:
                return BookStatus.IN_LIBRARY;
        }
    }
}

